Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug with assert!() calling the wrong edition of panic!(). #81647

Merged
merged 2 commits into from
Feb 3, 2021

Conversation

m-ou-se
Copy link
Member

@m-ou-se m-ou-se commented Feb 1, 2021

The span of panic! produced by the assert macro did not carry the right edition. This changes assert to call the right version.

Also adds tests for the 2021 edition of panic and assert, that would've caught this.

The span of `panic!` produced by the `assert` macro did not carry the
right edition. This changes `assert` to call the right version.
@rust-highfive
Copy link
Collaborator

r? @lcnr

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 1, 2021
@lcnr
Copy link
Contributor

lcnr commented Feb 2, 2021

think this looks right, but don't understand it perfectly, so

r? @petrochenkov

@rust-highfive rust-highfive assigned petrochenkov and unassigned lcnr Feb 2, 2021
@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Feb 2, 2021

📌 Commit ed1de99 has been approved by petrochenkov

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 2, 2021
jackh726 added a commit to jackh726/rust that referenced this pull request Feb 2, 2021
…nkov

Fix bug with assert!() calling the wrong edition of panic!().

The span of `panic!` produced by the `assert` macro did not carry the right edition. This changes `assert` to call the right version.

Also adds tests for the 2021 edition of panic and assert, that would've caught this.
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 2, 2021
Rollup of 14 pull requests

Successful merges:

 - rust-lang#80593 (Upgrade Chalk)
 - rust-lang#81260 (Add .editorconfig)
 - rust-lang#81455 (Add AArch64 big-endian and ILP32 targets)
 - rust-lang#81517 (Remove remnants of the santizer runtime crates from bootstrap)
 - rust-lang#81530 (sys: use `process::abort()` instead of `arch::wasm32::unreachable()`)
 - rust-lang#81544 (Add better diagnostic for unbounded Abst. Const)
 - rust-lang#81588 (Add doc aliases for "delete")
 - rust-lang#81603 (rustbuild: Don't build compiler twice for error-index-generator.)
 - rust-lang#81634 (Add long explanation e0521)
 - rust-lang#81636 (Directly use `Option<&[T]>` instead of converting from `Option<&Vec<T>>` later on)
 - rust-lang#81647 (Fix bug with assert!() calling the wrong edition of panic!().)
 - rust-lang#81655 (Improve wording of suggestion about accessing field)
 - rust-lang#81665 (Fix out of date `Scalar` documentation)
 - rust-lang#81671 (Add more associated type tests)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 7f2eeb1 into rust-lang:master Feb 3, 2021
@rustbot rustbot added this to the 1.51.0 milestone Feb 3, 2021
@m-ou-se m-ou-se deleted the assert-2021-fix branch March 27, 2021 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants